home *** CD-ROM | disk | FTP | other *** search
- @echo off
- REM ZIPGRP.BAT Backup critical NDW files in case of General Protection Fault in
- REM USER.EXE error message. This file is very specific create for a Nombas
- REM customer
-
-
- CEnvi %0.bat
- GOTO CENVI_EXIT
-
- #include <Screen.lib>
-
- Start:
- ScreenClear();
-
- DrawEmptyMessageWindow(TRUE);
-
- ScrWrite("RUN THIS FILE ANY TIME YOU HAVE MADE CHANGES TO YOUR NORTON DESKTOP",
- 1,4,YELLOW,BLUE);
-
- SetAttribute(WHITE,BLUE);
- ScrWrite("Reduce the time to get NDW up and running again after receiving",10,5);
- ScrWrite("the error Message \"NDW Caused GPF in module USER.EXE\".",11,5);
- ScrWrite("Up to 3 compressed files will be copied to your b: drive; groups,",13,5);
- ScrWrite("groups1 and groups2 (groups.zip will be the most recent copy).",14,5);
- ScrWrite("If you get the GPF error, begin unzipping these files in your NDW",16,5);
- ScrWrite("directory until Windows loads properly.",17,5);
-
- ScrWrite("Do You Want To Run This Program Now (Y/N)",21,16,YELLOW,BLUE);
- SetCursor(21,60);
-
- while ( !strchr("YN",Answer=toupper(getch())) )
- putchar('\a'); // beep for invalid answer
- putchar(Answer);
- if ( 'Y' == Answer ) {
-
-
- system("c:"), system("cd \\ndw");
- TextBox(23,15,23,61,BLUE,BLUE);
- ScrWrite("Insert a Diskette In Drive B",4,23,WHITE,BLUE);
- ScrWrite("Press Any Key When Ready",5,25,WHITE,BLUE);
- getch();
-
- if ( FloppyInserted('B') )
- Zipadeedoodah();
- else {
- ErrorMessage();
- goto Start;
- }
- }
-
- Zipadeedoodah() // routine to do the zipping work
- {
- DrawEmptyMessageWindow();
- ScrWrite("Compressing NDW QAG, DAT and BIN Files",4,18,LIGHTRED,BLUE);
- system("pkzip -a groups.zip @ndw.grp > nul");
- DrawEmptyMessageWindow();
-
- // check for previously zipped files and rename them 2 levels deep
- system("b:");
- // similar to other scrput statements except that the Text is blinking
- ScrWrite("Shuffling Files on Drive B",4,24,WHITE,BLUE|BLINK);
- system("if exist groups1.zip move groups1.zip groups2.zip > nul");
- system("if exist groups.zip move groups.zip groups1.zip > nul");
-
- system("c:"), system("cd \\ndw");
- DrawEmptyMessageWindow();
- ScrWrite("Moving Zipped File to Drive B",4,24,WHITE,BLUE);
- system("mv groups.zip b: > nul");
- DrawEmptyMessageWindow();
- }
-
- ErrorMessage() // called to display error
- {
- DrawEmptyMessageWindow();
- ScrWrite("Drive B Not Ready",4,28);
- ScrWrite("Press any key to continue",5,25);
- getch();
- }
-
- FloppyInserted(DriveLetter) // code taken from FLOPPYIN.BAT off of the
- { // NOMBAS BBS. True if inserted, else False
- BLObSize(buf,5000)// prepare a big buffer
- for ( i = 0; i < 3; i++ ) {
- reg.ah = 2 // code for reading sectors
- reg.al = 1 // read one sector
- reg.ch = 0 // track number
- reg.cl = 1 // sector number
- reg.dh = 0 // disk side (0 or 1)
- reg.dl = toupper(DriveLetter) - 'A'
- reg.es = segment(buf) // es:bx point to buffer
- reg.bx = offset(buf)
- if ( interrupt(0x13,reg,outreg) )
- return(True); // floppy read OK (carry flag not set)
- }
- return(False);
- }
-
- DrawEmptyMessageWindow(IncludeBorder) // repeat this frequent call
- {
- if ( va_arg() && IncludeBorder )
- TextBox(3,10,6,62,WHITE,BLUE,DOUBLE_LINE|SHADOW);
- else
- TextBox(4,11,5,61,WHITE,BLUE);
- }
-
- :CENVI_EXIT
- cd \
- cls